package com.wash.shoes.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wash.shoes.domain.vo.OrderCommentVo;
import com.wash.shoes.entity.CustomerPo;
import com.wash.shoes.entity.OrderCommentPo;
import com.wash.shoes.mapper.OrderCommentMapper;
import com.wash.shoes.page.PageFactory;
import com.wash.shoes.service.OrderCommentService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单的评价 服务实现类
 * </p>
 *
 * @author ljg
 * @since 2024-12-03
 */
@Service
public class OrderCommentServiceImpl extends ServiceImpl<OrderCommentMapper, OrderCommentPo> implements OrderCommentService {

    /**
     * 评论的列表
     *
     * @param orderCommentPo
     * @return
     */
    @Override
    public Page<OrderCommentVo> pageList(OrderCommentPo orderCommentPo) {
        Page<OrderCommentVo> page = PageFactory.defaultPage();
        List<OrderCommentVo> dataList = baseMapper.pageList(page, orderCommentPo);
        page.setRecords(dataList);
        return page;
    }

    /**
     * 订单的评论
     *
     * @param orderId
     * @return
     */
    @Override
    public OrderCommentPo getByOrderId(String orderId) {
        return this.baseMapper.getByOrderId(orderId);
    }


}
